
import 'package:flutter/material.dart';
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';


class EditVisibilityPage extends StatefulWidget {
  @override
  _EditVisibilityState createState() => _EditVisibilityState();
}

class _EditVisibilityState extends State<EditVisibilityPage> {
  @override
  Widget build(BuildContext context) {
    return KeyboardDismissOnTap(child: Scaffold(
      appBar: AppBar(
        title: Text('图文编辑'),
      ),
      body: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          TextField(
            keyboardType: TextInputType.text,
            decoration: InputDecoration(
              labelText: 'Input box for keyboard test',
            ),
          ),
          Container(height: 60.0),
          KeyboardVisibilityBuilder(builder: (context, visible) {
            return Text(
              'The keyboard is: ${visible ? 'VISIBLE' : 'NOT VISIBLE'}',
            );
          }),
        ],
      ),),
    );
  }
}